Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
flare-edge-cli deploy --var ...when the loaded project config has a nilbindings.varsmapProblem
A user reported that running a deploy with one or more
--var KEY=valueflags could crash the CLI with:The panic occurred in
internal/service/deploy/service.gowhile handling deploy-time variable overrides.Root Cause
The deploy path initialized
wranglerCfg.Varswhen it was nil, but it also wrote the same entries intoproject.Bindings.Varswithout checking whether that map had been initialized.That means projects loaded from disk with a missing or nil
bindings.varsfield could panic as soon as--varwas used, even though the equivalent Wrangler config path had already been guarded.Fix
This PR:
applyVars(...)helperwranglerCfg.Varsandproject.Bindings.Varswhen needed--varentries instead of touching either mapThe behavior stays the same for valid inputs, but the nil-map panic is removed.
Testing
go test ./internal/service/deploygo test ./...Added regression coverage in
internal/service/deploy/service_test.goto verify that:KEY=valuepairs are applied to both config modelsUser Impact
After this change, deploy commands like:
flare-edge-cli deploy --path services/telegram-adapter --var "ORCHESTRATOR_URL=https://threadline-orchestrator.paoloanzani.workers.dev" --jsonshould no longer panic when the project config was loaded with an empty or omitted
bindings.varsmap.